<?php
include_once '../Login/databaseconnection.php';
   $T_NIC_Number=$_SESSION['T_NIC_Number'];
   $Training_Id=$_SESSION['Training_Id'];
  $_SESSION['T_NIC']=$_SESSION['T_NIC_Number'];
   $_SESSION['Tra_Id']=$_SESSION['Training_Id'];
   	$Training_Idc=$_POST['Training_Idc'];
	$T_NIC_Numberc=$_POST['T_NIC_Numberc'];
    $Member_Idc=$_POST['Member_Idc'];
    $From_Datec=$_POST['From_Datec'];
	date_default_timezone_set("Europe/Paris");
    $t_d=date("Y/m/d");
   
   if($Training_Idc==""||$T_NIC_Numberc==""||$Member_Idc==""||$From_Datec=="")
	{
		   $_SESSION['errorin']="Please check your inputs!";
	 }
	else
	{
	
$sql=mysql_query("UPDATE resource_team SET Training_Id='$Training_Idc',T_NIC_Number='$T_NIC_Numberc',Member_Id='$Member_Idc',From_Date='$From_Datec',Last_Updated_Date='$t_d' WHERE Training_Id='$Training_Id' AND T_NIC_Number='$T_NIC_Number'");

 if(mysql_affected_rows()!=0)
  {
$_SESSION['error']="This record is successfully updated!";
  }
  if(mysql_affected_rows()==0)
  {
 $_SESSION['error']="Sorry unable to update this record!";
  }
	
}
  ?>

